package supermarket.dao.impl;

import java.util.List;

import supermarket.dao.ProductCatalog;
import supermarket.dao.ProductDao;
import supermarket.model.Product;

public class ProductCatalogImpl implements ProductCatalog {

	private ProductDao productDao;
	
	public void setProductDao(ProductDao productDao) {
		this.productDao = productDao;
	}
	
	@Override
	public Product getProduct(Integer id) {
		return this.productDao.findProduct(id);
	}
	
	@Override
	public List getProductByName(String name) {
		return this.productDao.findProductByName(name);
	}
	
	@Override
	public List getProductByCategory(String category) {
		return this.productDao.findProductByCategory(category);
	}
	
	@Override
	public List getProductList() {
		return this.productDao.findAll();
	}
	
	@Override
	public void addProduct(Product product) {
		this.productDao.addProduct(product);
	}
	
	@Override
	public void addProductByName(String name) {
		this.productDao.addProductByName(name);
	}
	
	@Override
	public void updateProduct(Product product) {
		this.productDao.updateProduct(product);
	}
	
	@Override
	public void removeProduct(Product product) {
		this.productDao.removeProduct(product);
	}
	
}
